From 1873ad501df8f0fffb76a3cf1007fd22b70ba810 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 6 May 2026 15:37:30 +0100 Subject: [PATCH] [PATCH] check for hb_shape_full failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Caolán McNamara Change-Id: I5fafcb7d592fb4c9091cb2bab64cb6ac47462d71 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2102 Reviewed-by: Miklos Vajna (cherry picked from commit 22c19be8fae977a90f83a82d8acccd0b46c7cf20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204946 Tested-by: Jenkins Reviewed-by: Julien Nabet Gbp-Pq: Name check-for-hb_shape_full-failure.diff --- vcl/source/gdi/CommonSalLayout.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 7e2bcd6290c..c9f3f4f09a4 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -465,9 +465,11 @@ bool GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay // but there is no harm in always including it, HarfBuzz will // ignore unavailable shapers. const char*const pHbShapers[] = { "graphite2", "coretext_aat", "ot", "fallback", nullptr }; - bool ok = hb_shape_full(pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size(), pHbShapers); - assert(ok); - (void) ok; + if (!hb_shape_full(pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size(), pHbShapers)) + { + SAL_WARN("vcl.harfbuzz", "hb_shape_full failed"); + hb_buffer_set_length(pHbBuffer, 0); + } int nRunGlyphCount = hb_buffer_get_length(pHbBuffer); hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, nullptr); -- 2.39.5